package loadData;

import java.awt.Image;
import javax.imageio.ImageIO;

public class Resources {

    //Waffen
    private Image rocketL, rocketR, kornspitzR, kornspitzL;
    //Hintergrund und Explosion
    private Image background, explosion;
    //Figuren
    private Image vogiL, vogiR;
    //Spieler Figuren
    private Image player1Left, player1Right, player2Left, player2Right;
    //Spieler Waffen
    private Image player1WeaponLeft, player1WeaponRight, player2WeaponLeft, player2WeaponRight;

    public Resources() throws Exception {
        vogiL = ImageIO.read(this.getClass().getResource("/grafiken/figuren/testfigurSet/Vogi_L.png"));
        vogiR = ImageIO.read(this.getClass().getResource("/grafiken/figuren/testfigurSet/Vogi_R.png"));
        background = ImageIO.read(this.getClass().getResource("/grafiken/backgrounds/s.jpg"));
        rocketR = ImageIO.read(this.getClass().getResource("/grafiken/weapons/rakete_R.png"));
        rocketL = ImageIO.read(this.getClass().getResource("/grafiken/weapons/rakete_L.png"));
        kornspitzL = ImageIO.read(this.getClass().getResource("/grafiken/weapons/kornspitz_L.png"));
        kornspitzR = ImageIO.read(this.getClass().getResource("/grafiken/weapons/kornspitz_R.png"));
        explosion = ImageIO.read(this.getClass().getResource("/grafiken/weapons/explosion.png"));
    }

    public Image getBackground() {
        return background;
    }

    public Image getPlayer1Left() {
        return player1Left;
    }

    public Image getPlayer1Right() {
        return player1Right;
    }

    public Image getPlayer2Left() {
        return player2Left;
    }

    public Image getPlayer2Right() {
        return player2Right;
    }

    public Image getPlayer1WeaponLeft() {
        return player1WeaponLeft;
    }

    public Image getPlayer1WeaponRight() {
        return player1WeaponRight;
    }

    public Image getPlayer2WeaponLeft() {
        return player2WeaponLeft;
    }

    public Image getPlayer2WeaponRight() {
        return player2WeaponRight;
    }

    public Image getExplosion() {
        return explosion;
    }

    public void setPlayer1Image(String figureName) {
        if (figureName.equalsIgnoreCase("vogi")) {
            player1Left = vogiL;
            player1Right = vogiR;
        }
    }

    public void setWeaponPlayer1(String weaponName) {
        if (weaponName.equalsIgnoreCase("rakete")) {
            player1WeaponLeft = rocketL;
            player1WeaponRight = rocketR;
        }else if(weaponName.equalsIgnoreCase("kornspitz")){
            player1WeaponLeft = kornspitzL;
            player1WeaponRight = kornspitzR;
        }
    }

    public void setPlayer2Image(String figureName) {
        if (figureName.equalsIgnoreCase("vogi")) {
            player2Left = vogiL;
            player2Right = vogiR;
        }
    }

    public void setWeaponPlayer2(String weaponName) {
        if (weaponName.equalsIgnoreCase("rakete")) {
            player2WeaponLeft = rocketL;
            player2WeaponRight = rocketR;
        }else if(weaponName.equalsIgnoreCase("kornspitz")){
            player2WeaponLeft = kornspitzL;
            player2WeaponRight = kornspitzR;
        }
    }

    public Image getRocketL() {
        return rocketL;
    }

    public Image getRocketR() {
        return rocketR;
    }

    public Image getVogiL() {
        return vogiL;
    }

    public Image getVogiR() {
        return vogiR;
    }

    public Image getKornspitzL() {
        return kornspitzL;
    }

    public Image getKornspitzR() {
        return kornspitzR;
    }
}
